<?php

namespace app\mobile\controller;
use  think\Controller;
use app\admin\validate\Message as MessageValidate;
use app\admin\model\Message as MessageModel;
use think\Session;

class Message extends Base
{
    public function index(){
        return $this->fetch();
    }
    public function save(){
        $data=$this->request->post();

      //  print_r($data);
       // halt($data);


        $validate=new MessageValidate();
        if(!$validate->check($data)){
            $this->error($validate->getError());
        }
        unset($data['__token__']);
        MessageModel::create($data);
        $this->success('提交成功');
    }
}